<template>
  <el-dialog
    v-el-drag-dialog
    :title="title"
    :visible.sync="openSheet"
    width="1000px"
    :destroy-on-close="true"
    :close-on-click-modal="false"
  >
    <el-form ref="form" :model="form" disabled label-width="100px">
      <el-row>
        <el-col :span="8">
          <el-form-item :label="$t('samplesItem')">
            <el-input
              v-model="form.item_no"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('samplesMenuCode')">
            <el-input
              v-model="form.menu_desc"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('samplesStatus')">
            <el-input
              v-model="form.status_desc"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item :label="$t('samplesWarehouse')">
            <el-input
              v-model="form.warehouse"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item :label="$t('samplesLocation')">
            <el-input
              v-model="form.location"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('samplesValidDate')">
            <el-date-picker
              v-model="form.valid_date"
              type="date"
              value-format="yyyy-MM-dd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('samplesInvalidDate')">
            <el-date-picker
              v-model="form.invalid_date"
              type="date"
              value-format="yyyy-MM-dd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('samplesQuantity')">
            <el-input
              v-model="form.quantity"
              type="number"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$t('samplesNote')">
            <el-input
              v-model="form.note"
              type="textarea"
              :rows="1"
              autosize
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('createdUser')">
            <el-input
              v-model="form.created"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('createdDate')">
            <el-input
              v-model="form.created_date"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('createdProgram')">
            <el-input
              v-model="form.created_program"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('updatedUser')">
            <el-input
              v-model="form.updated"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('updatedDate')">
            <el-input
              v-model="form.updated_date"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('updatedProgram')">
            <el-input
              v-model="form.updated_program"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">{{ $t('cancel') }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import elDragDialog from '@/directive/el-drag-dialog'
export default {
  directives: { elDragDialog },
  data() {
    return {
      title: undefined,
      openSheet: false,
      form: {}
    };
  },
  methods: {
    async openSheetDialog(data) {
      this.openSheet = !this.openSheet;
      this.title = this.$t('samplesInquire');
      this.form = data;
    },
    cancel() {
      this.openSheet = !this.openSheet;
    }
  }
};
</script>

    <style></style>

